<template>
  <span class="item-group">
    <el-button icon="el-icon-aim" size="mini" :disabled="single" @click="handleExploration">项目勘探点</el-button>
    <el-button icon="el-icon-takeaway-box" size="mini" :disabled="single" @click="handleEquipment()">分配设备</el-button>
    <el-dropdown @command="handlePersonal">
      <span class="el-dropdown-link"><i class="el-icon-user" /> 分配人员<i class="el-icon-arrow-down el-icon--right" /> </span>
      <el-dropdown-menu slot="dropdown">
        <el-dropdown-item :disabled="single" command="1">司钻员</el-dropdown-item>
        <el-dropdown-item :disabled="single" command="2">描述员</el-dropdown-item>
        <el-dropdown-item :disabled="single" command="3">土工试验员</el-dropdown-item>
        <el-dropdown-item :disabled="single" command="4">物探人员</el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
    <el-button icon="el-icon-data-analysis" size="mini" :disabled="single" @click="handleDataAcquisition()">数据采集</el-button>
  </span>
</template>

<script>
export default {
  name: 'Index',
  props: {
    single: {
      type: Boolean,
      default() {
        return true
      }
    }
  },
  data() {
    return {

    }
  },
  methods: {
    // 项目勘探点
    handleExploration() {
      this.$parent.handleExploration()
    },
    // 分配设备
    handleEquipment() {
      this.$parent.handleEquipment()
    },
    // 分配人员
    handlePersonal(personType) {
      this.$parent.handlePersonal(personType)
    },
    // 数据采集
    handleDataAcquisition() {
      this.$parent.handleDataAcquisition()
    }
  }
}
</script>

